Accusoft.ImagXpress13.Net
Delete Multiple Pages

The ImageX.DeletePage method deletes a single page at a time.  The ImageX.DeletePages method allows the developer to specify the number of pages to delete.

The ImageX.DeletePage method looks like this:

C# Example
Copy Code
public static void DeletePage(
   ImagXpress imagXpress,
   string filename,
   int pageNumber
)
ImageX.DeletePage(imagXpress, filename, pageNumber);

The ImageX.DeletePages method looks like this:

C# Example
Copy Code
public static void DeletePages(
   ImagXpress imagXpress,
   string filename,
   int pageNumber,
   int numberOfPages
)
ImageX.DeletePages(imagXpress, filename, pageNumber, numberOfPages);

Deleting the First Three Pages in a TIFF Document

Using ImageX.DeletePage to delete the first 3 pages in a multipage TIFF document requires code similar to this:

 
Copy Code
for (int i = 0; i < 3; i++)
{
ImageX.DeletePage(imagXpress1, filename, 1);
}

Using ImageX.DeletePages, the previous example is done like this:

 
Copy Code
ImageX.DeletePages(imagXpress1, filename, 1, 3);

Deleting the Last Three Pages in a TIFF Document

Using ImageX.DeletePage to delete the last 3 pages in a multipage TIFF document requires code similar to this:

 
Copy Code
int numberOfPagesInDocument = ImageX.NumPages(imagXpress1, filename);
int pageToDelete = numberOfPagesInDocument ‐ 2;
for (int i = 0; i < 3; i++)
{
ImageX.DeletePage(imagXpress1, filename, pageToDelete);
}

Using the ImageX.DeletePages the previous example is done like this:

 
Copy Code
int numberOfPagesInDocument = ImageX.NumPages(imagXpress1, filename);
int startPageToDelete = numberOfPagesInDocument ‐ 2;
ImageX.DeletePages(imagXpress1, filename, startPageToDelete, 3);

 

 


©2019. Accusoft Corporation. All Rights Reserved.

Send Feedback